package com.smh.a02BigIntegerDemo2;

import java.math.BigInteger;
import java.util.Random;

public class Test {
    public static void main(String[] args) {


        Random random = new Random();

        //0~2的num-1次方
        for (int i = 0; i < 20; i++) {
            BigInteger bigInteger = new BigInteger(9,random);
            System.out.println(bigInteger);
        }
        BigInteger bigInteger1 = new BigInteger("1111111111111111111111111111111111111111111110000");
        System.out.println(bigInteger1);
        //只能出现进制对应的数

        BigInteger bigInteger2 = new BigInteger("100001111",2);
        System.out.println(bigInteger2);

        //将long型转化为BigInteger行
        long a = 1000L;
        BigInteger bigInteger = BigInteger.valueOf(a);
        BigInteger bigInteger3 = BigInteger.valueOf(Long.MAX_VALUE);
        System.out.println(bigInteger+","+bigInteger3);
        //bigInteger=1;
        System.out.println(bigInteger.add(bigInteger3));
        System.out.println(bigInteger.toString());


    }
}
